//
//  SAPaperSetCollectionFootView.m
//  saasRetail
//
//  Created by 黄志刚 on 2022/5/17.
//

#import "SAPaperSetCollectionFootView.h"

@interface SAPaperSetCollectionFootView ()

@property (nonatomic, strong) UIButton *previewBtn;

@end

@implementation SAPaperSetCollectionFootView

- (instancetype)initWithFrame:(CGRect)frame
{
    if (self = [super initWithFrame:frame]) {
        self.backgroundColor = kBgColor;
        [self initUI];
    }
    return self;
}

-(void)clickedPreviewBtn {
    !self.previewBlock ?: self.previewBlock();
}

-(void)initUI {
    [self addSubview:self.previewBtn];
}

-(UIButton *)previewBtn {
    if (!_previewBtn) {
        _previewBtn = [UIButton buttonWithType:UIButtonTypeCustom];
        [_previewBtn setTitle:@"预览效果" forState:UIControlStateNormal];
        [_previewBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
        _previewBtn.frame = CGRectMake(kScaleNum(99), kScaleNum(34), kScaleNum(177), kScaleNum(40));
        _previewBtn.titleLabel.font = kFont(18);
        _previewBtn.layer.cornerRadius = kScaleNum(3);
        _previewBtn.layer.masksToBounds = YES;
        [_previewBtn addTarget:self action:@selector(clickedPreviewBtn) forControlEvents:UIControlEventTouchUpInside];
        _previewBtn.backgroundColor = kBuleColor;
    }
    return _previewBtn;
}

@end
